//
//  NewShangJiaJiesuanViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/4/2.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewShangJiaJiesuanViewController.h"
#import "JTCSM.h"
#import "MyInfoView.h"
static CGFloat space = 20;
static CGFloat myinfoHeight= 50;
@interface NewShangJiaJiesuanViewController ()

@end

@implementation NewShangJiaJiesuanViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = NO;
    [self.view setBackgroundColor:RGBACOLOR(241, 241, 241, 1)];
    [df isRemoveTarbar:YES];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    // Do any additional setup after loading the view.
    [self layoutsubView];
}
- (void)layoutsubView{
    CGFloat infoheight = 40;
    UIView *infoView = [[UIView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight, KCONTROLLERWith, infoheight)];
    [self.view addSubview:infoView];
    infoView.backgroundColor = RGBACOLOR(241, 241, 241, 1);
    infoView.userInteractionEnabled = YES;
    
    NSString *infoStr = @"绑定本人银行卡信息";
    float infoSize = 12;
    CGRect inforect = [df labelHeightWithContent:infoStr height:50 font:infoSize];
    UIImageView *infoImagev = [[UIImageView alloc]initWithFrame:CGRectMake(space, (infoheight-inforect.size.height)/2, inforect.size.height, inforect.size.height)];
    infoImagev.image = [UIImage imageNamed:@"tanhao.png"];
    [infoView addSubview:infoImagev];
    
    UILabel *infolabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(infoImagev)+5, (infoheight-inforect.size.height)/2, KCONTROLLERWith, inforect.size.height) text:infoStr font:infoSize textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(51, 51, 51, 1) backgroundColor:nil];
    [infoView addSubview:infolabel];
    
    
    NSArray *array = @[@"开户名称",@"开户银行",@"开户账号",@"开户地址"];
    NSArray *contentarray = @[@"请输入开户名称",@"请选择开户银行",@"请输入开户账号",@"省/市"];
    NSArray *array1 = @[@"开户支行"];
    NSArray *contenarray1 = @[@"选择支行"];
    
    for (int i = 0; i < array.count; i++) {
        MyInfoView *view1 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(infoView)+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:nil title:array[i]placeholder:contentarray[i] isShowLabel:(i==0||i==2)?textfieldtype:ImageandlabelViewType radioBtnIndex:0 GroupId:@""];
        view1.tag = 100+i;
        view1.userInteractionEnabled = YES;
        view1.footerLabel.text = contentarray[i];
        view1.footerLabel.textColor = [df colorWithHexString:@"999999" alpha:1];
        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view1];
        [self.view addSubview:view1];
        view1.lineView.hidden = i ==array.count-1?YES:NO;
    }
    [df lineViewWithHeightofTop:KVIEW_Y(infoView)+myinfoHeight*array.count+10 superView:self.view spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:10];
    for (int i = 0; i < array1.count; i++) {
        MyInfoView *view2 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(infoView)+myinfoHeight*array.count+10+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:nil title:array1[i]placeholder:nil isShowLabel:ImageandlabelViewType radioBtnIndex:0 GroupId:@""];
        view2.tag = 200+i;
        view2.userInteractionEnabled = YES;
        view2.footerLabel.text = contenarray1[i];
        view2.footerLabel.textColor = [df colorWithHexString:@"999999" alpha:1];
        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view2];
        [self.view addSubview:view2];
        view2.lineView.hidden = i ==array1.count-1?YES:NO;
    }

    
    CGFloat btnspace = 20;
    CGFloat btnHeight = 50;
    UIButton *LoginBtn =[[UIButton alloc] initWithFrame:CGRectMake(btnspace, KVIEW_Y(infoView)+myinfoHeight*array.count+myinfoHeight*array1.count+10+30 , (KCONTROLLERWith-2*btnspace), btnHeight)];
    LoginBtn.backgroundColor =KZhuTiRGB;
    [LoginBtn setTitle:@"提交" forState:UIControlStateNormal];
    [LoginBtn setTitleColor:[df colorWithHexString:@"333333" alpha:1] forState:UIControlStateNormal];
    LoginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [LoginBtn addTarget:self action:@selector(gotoMainV) forControlEvents:UIControlEventTouchUpInside];
    LoginBtn.tag = 10002;
    [self.view addSubview:LoginBtn];
    [df layerWithView:LoginBtn radius:btnHeight/2 width:0 color:nil];
}

- (void)gotoVC:(UITapGestureRecognizer *)tap{
    
}
- (void)gotoMainV{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
